import 'dart:ui';

import 'package:intl/intl.dart';

import '../generated/l10n.dart';
import '../route/RouteUtils.dart';

class TimeUtils {
  static String intlTime() {
    Intl.defaultLocale = (window.locale.languageCode == "zh" ? "zh" : "en");
    String dateString = DateFormat(S.of(RouteUtils.context).mmyyyyddHhmm)
        .format(DateTime.now());
    return dateString;
  }

  static String intlDate() {
    Intl.defaultLocale = (window.locale.languageCode == "zh" ? "zh" : "en");
    String dateString =
        DateFormat(S.of(RouteUtils.context).yyyymmdd).format(DateTime.now());
    return dateString;
  }
}
